Writing A JAWS Script to Get Who's Online In WL Messenger

Category: Geeks r Us

Post 1 by TylerK (This site is so "educational") on Monday, 26-May-2008 16:05:04

Hey all,

I am trying to write a JAWS script to get a list of who is actually online (as opposed to away, busy, etc) in Windows Live Messenger version 8.5.1302. This is what I know:
The contact list is a group of MSAA objects that is mixed in with everything else on the screen, like the buttons, status menu, ads, etc.
Querying the accName, accDescription, accValue, and accHelp properties for any object representing a contact in the contact list returns the same thing.
Getting the text of the rectangle for the object whose name is "Online" returns "Online (x)" where x is the number of people visible.

This is what I have so far:

Script SayOnlineList ()
var
object o,
int childID,
handle hwnd,
int i,
int j,
string list,
int virtualize
let hwnd=getFocus()
if !stringContains(getWindowClass(hwnd), "DirectUIHWND") then
return
say("Not on contact list", OT_ERROR)
endIf
let o=getObjectAtPoint(childID, getCursorCol(), getCursorRow())
EndScript

Tyler

Post 2 by Harmony (I've now got the silver prolific poster award! wahoo!) on Wednesday, 28-May-2008 14:27:09

I think in Windows Live Messenger, it already says who is online. It just sorts the contacts into groups. At least that's what it did for mine. You might have to change the sort thing in the contacts menu.

Post 3 by TylerK (This site is so "educational") on Wednesday, 28-May-2008 14:46:08

No, that's not what I'm trying to do. I'm trying to make JAWS speak, on a single keystroke, the people whose status is "Online" and not the other status options (away, busy, etc).

Post 4 by rat (star trek rules!) on Wednesday, 28-May-2008 16:04:44

tyler, what's the point? just look at the list and sort them out yourself

Post 5 by The Lil Dark Piggy (This site is so "educational") on Wednesday, 28-May-2008 18:00:18

I get where Tyler is coming from, simular to the online keystroke in Skype, right?

Post 6 by Dave_H (the boringest guy you'll ever know) on Thursday, 29-May-2008 13:13:13

If you don't want Tyler's script, don't use it. Writing something like is a good way to teach yourself the interface.

Post 7 by TylerK (This site is so "educational") on Thursday, 29-May-2008 15:02:44

Good point, Dave. And Mikey, you could do that, but what if you have a lot of contacts, like I do (I have 51 contacts on my list)?

Post 8 by Toonhead71 (move over school!) on Thursday, 29-May-2008 19:42:45

Yes, I get what he wants to do. In the latest scripts for skype, it's possible to press control plus o, I believe it is? and have all the contacts who are currently online. for example, you might hear, 5 contacts online. folloed by their names, in alphabetical order. I think this could definitely be handy.

Post 9 by rat (star trek rules!) on Thursday, 29-May-2008 20:57:30

i've never been able to get the skype script to work. and you're not the only one witha lot of contacts tyler

Post 10 by chikorita (move over school!) on Thursday, 29-May-2008 20:58:25

Yeah i think it would be cool to have the wquivilant of skypewatch and the command key for wlm. Speaking of wlm, it won't read msg's automatically anymore, with the option in verbosity turned on. I didn't do anything to it.

Post 11 by Harmony (I've now got the silver prolific poster award! wahoo!) on Friday, 30-May-2008 5:10:40

I didn't know there was a script to do a similar thing on skype. I thought it was just done automatically.

Post 12 by TylerK (This site is so "educational") on Saturday, 31-May-2008 15:12:54

This is all the code I have written so far, and it looks complete, but the darned thing still isn't working. There was one point where I had written some code which had gotten me into an infinite loop, but I resolved that and tried something else (which is what I have in this code), but it still won't do what it's supposed to do.

;SayOnlineList script and supporting code. Written by TK, 2008-05-29 through 2008-05-31.
Const
;Constant to represent the child ID of the object itself, taken from skypeMSAA.jsh (a direct translation of parts of oleacc.h and winable.h, MSAA SDK).
childID_self=0

String Function wlStringCat (string s1, string s2)
;Adapted from the olStringCat and aimstringCat functions written by Doug Lee (<dgl@dlee.org>, Bartimaeus Group).
return stringChopLeft(""+s1+s2, 1)
EndFunction

Script SayOnlineList ()
var
object o,
int childID,
handle hwnd,
int i,
string list,
string temp,
int virtualize
let virtualize=isSameScript()
let hwnd=getFocus()
if !stringContains(getWindowClass(hwnd), "DirectUIHWND") then
return
say("Not on contact list", OT_ERROR)
endIf
PCCursor()
jawsTopOfFile()
let o=getObjectAtPoint(childID, getCursorCol(), getCursorRow())
if stringContains(stringLower(o.accName(childID_self)), "online (") then
let i=0
let list=""
;I have to do it this way (by using the JAWS cursor) because previous methods have not worked. [TK, 2008-05-31]
jawsHome()
saveCursor() jawsCursor() saveCursor()
routeJAWSToPC()
while (!stringContains(stringLower(o.accName(childID_self)), "mobile")) || (!stringContains(stringLower(o.accName(childID)), "offline"))
nextLine()
jawsHome()
let o=getObjectAtPoint(childID, getCursorCol(), getCursorRow())
let temp=o.accName(childID_self)
if stringContains(stringLower(temp), "(online)") then
let i=i+1
let temp=stringLower(temp)
let list=wlStringCat(list, "rn"+stringChopRight(temp, stringLength("(online)")))
jawsHome()
endIf
endWhile
let list=wlStringCat(intToString(i)+" contacts online:", "rn"+list)
if virtualize then
sayFormattedMessage(OT_USER_BUFFER, list)
else
sayFormattedMessage(OT_USER_REQUESTED_INFORMATION, list, "")
endIf
endIf
EndScript

Could someone look at this and see what I'm doing wrong?

Post 13 by Unreleased Secrets (Zone BBS Addict) on Monday, 16-Jun-2008 17:17:55

i dont know much about jaws scripting, but it probably gets stuck at the quick search edit?